package com.systop.busafter.user.mapper;
import com.systop.commer.pojo.User;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface UserMapper {
    /*
     * 修改user
     * user user
     * return int
     * csh
     *
      */
   @Update("update user set user_name_n = #{user_name_n},user_password = #{user_password},user_remarks = #{user_remarks} ," +
            "user_name = #{user_name},user_personal = #{user_personal},user_card = #{user_card}," +
            "user_head = #{user_head},user_other = #{user_other},user_number = #{user_number},user_s = #{user_s} where user_id = #{user_id}")
    int updatauser(User user);


    //"time = #{time,jdbcType=TIMESTAMP} "  时间类型

    /*
     * 注册user
     * user user(账号，密码。，手机号)
     * return int
     * csh
     * */
    @Insert("insert into user(user_name_n,user_password,user_number,user_remarks,user_name,user_personal,user_card,user_head,user_other,user_s) values " +
            "(#{user_name_n},#{user_password},#{user_number},#{user_remarks},#{user_name},#{user_personal},#{user_card},#{user_head},#{user_other},#{user_s})")
    int zcinsertuser(User user);


    /*
     * 账号登陆
     * user user
     * user user
     * csh
     * */
    @Select("select * from user where user_name_n = #{user_name_n} and user_password= #{user_password}")
    User userLogin(User user);

    /*
     * 手机号登陆
     * user user
     * user user
     * csh
     * */
    @Select("select * from user where user_number = #{user_number} and user_password= #{user_password}")
    User numuserLogin(User user);

    /*
     * 查看全部
     * 无
     * list
     * csh
     * */
    @Select("select * from user")
    List<User> userListall();

    /*
     * 用id查看user
     * user_id  int
     * list
     * csh
      */
    @Select("select * from user where user_id = #{user_id}")
    List<User> userIdlist(int user_id);

    /*
     * 删除user
     * user_id  int
     * return int
     * csh
     * */
    @Delete("delete from user where user_id=#{user_id}")
    int deleteuser(int user_id);

    /*
     * 用name查看user
     * String user_name
     * list
     * csh
     * */
    @Select("select * from user where user_name = #{user_name}")
    List<User> userNamelist(String user_name);
    /*
     * 用账号查看
     * user_name_n  String
     * list
     * csh
     * */
    @Select("select * from user where user_name_n = #{user_name_n}")
    List<User> userZhlist(String user_name_n);
    /*
     * 用账号查看
     * user_name_n  String
     * list
     * csh
     * */
    @Select("select * from user where user_name_n = #{user_name_n}")
    User userZhlist1(String user_name_n);
    /*
     * 用手机号查看
     * user_number  int
     * list
     * csh
     * */
    @Select("select * from user where user_number = #{user_number}")
    List<User> userNumlist(String user_number);


 /*
  * 用身份证号查看
  * user_card  String
  * list
  * */
 @Select("select * from user where user_card = #{user_card}")
 List<User> usercard(String user_card);


}
